﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using HZ.BidSystem.Model;
using System.Data;

namespace HZ.BidSystem.IBLL
{
    /// <summary>
    /// 报价接口
    /// </summary>
    public interface IBLL_Company
    {
        /// <summary>
        /// 报价
        /// </summary>
        /// <param name="bidids">报价编号列表</param>
        /// <param name="prices">价格列表</param>
        /// <returns>1成功报价 0 报价失败 2 数据库故障</returns>
        /// <param name="Azone">A区域是否报价1报价0不报价</param>
        /// <param name="Bzone">B区域是否报价1报价0不报价</param>
        /// <param name="Czone">C区域是否报价1报价0不报价</param>
        /// <returns></returns>

        int BidPrice(IList<int> bidids, IList<Double> prices, IList<int> Azone, IList<int> Bzone, IList<int> Czone, IList<int> Dzone, IList<int> Ezone);

        /// <summary>
        /// 议价报价
        /// </summary>
        /// <param name="bidids">投标编号</param>
        /// <param name="prices">议价报价</param>
        /// <returns>1成功报价 0 报价失败 2 数据库故障</returns>
        int BargainPrice(IList<int> bidids, IList<Double> prices, IList<string> bidpricesshuoming);
        /// <summary>
        /// 议价确认
        /// </summary>
        /// <param name="bidids">投标编号</param>
        /// <param name="prices">议价确认</param>
        /// <returns>1确认报价 0 报价失败 2 数据库故障</returns>
        int BargainPriceCheck(IList<int> bidids, IList<int> bidcheck);
        /// <summary>
        /// 议价报价
        /// </summary>
        /// <param name="bidids">投标编号</param>
        /// <param name="prices">议价报价</param>
        /// <param name="competetime">当前竞价轮次</param>
        /// <returns>1成功报价 0 报价失败 2 数据库故障</returns>
        int CompetePrice(IList<int> bidids, IList<Double> prices, int competetime);

        /// <summary>
        /// 解密报价
        /// </summary>
        /// <param name="companyid">解密企业编号</param>
        /// <returns>1 成功 0 失败</returns>
        int DecPrice(int companyid);

        /// <summary>
        /// 获取报价产品列表
        /// </summary>
        /// <param name="where">查询条件，CompanyId_Tb投标企业编号必填，无须显示在form表单</param>
        /// <param name="currentpage">当前页</param>
        /// <param name="pagesize">每页大小</param>
        /// <param name="totalrecord">记录总数</param>
        /// <returns>待绑定的实体列表</returns>
        IList<View_BidPrice> GetBidPrice(QBidPrice where, int currentpage, int pagesize, out int totalrecord);

        /// <summary>
        /// 获取报价产品列表，包含报价密文。
        /// </summary>
        /// <param name="where">查询条件</param>
        /// <param name="currentpage">当前页</param>
        /// <param name="pagesize">每页记录数</param>
        /// <param name="totalrecord">记录总数</param>
        /// <param name="pwd1">报价密码</param>
        /// <param name="pwd2">随机密码</param>
        /// <returns>数据源</returns>
        IList<View_BidPrice> GetBidPriceWithDec(object where, int currentpage, int pagesize, out  int totalrecord, string pwd1, string pwd2);



        /// <summary>
        /// 获取议价产品列表
        /// </summary>
        /// <param name="where"></param>
        /// <param name="currentpage"></param>
        /// <param name="pagessize"></param>
        /// <param name="totalrecord"></param>
        /// <param name="pwd1">报价密码</param>
        /// <param name="pwd2">随机密码</param>
        /// <returns></returns>
        IList<View_BargainPrice> GetBargainWithDec(object where, int currentpage, int pagessize, out int totalrecord, string pwd1, string pwd2);

        /// <summary>
        /// 获取竞价产品列表
        /// </summary>
        /// <param name="where"></param>
        /// <param name="currentpage"></param>
        /// <param name="pagessize"></param>
        /// <param name="totalrecord"></param>
        /// <param name="pwd1">报价密码</param>
        /// <param name="pwd2">随机密码</param>
        /// <returns></returns>
        IList<View_CompetePrice> GetCompeteWithDec(object where, int currentpage, int pagessize, out int totalrecord, string pwd1, string pwd2);

        /// <summary>
        /// 设置报价密码
        /// </summary>
        /// <param name="bidpwd">用户设置的报价密码</param>
        /// <param name="randpwd">随机密码</param>
        /// <returns>1成功 0 失败</returns>
        int SetBidPwd(string bidpwd, string randpwd, Int32 companyid, Int32 projectid);


        /// <summary>
        /// 检查报价密码正确性
        /// </summary>
        /// <param name="bidpwd">报价密码</param>
        /// <param name="randpwd">随机密码</param>
        /// <param name="CompanyId">企业编号</param>
        /// <returns>1 匹配 0 不匹配</returns>
        int CheckBidPwd(string bidpwd, string randpwd, Int32 CompanyId, Int32 projectid);


        /// <summary>
        /// 根据企业编号及项目编号获取企业开关
        /// </summary>
        /// <param name="CompanyId">企业编号</param>
        /// <param name="ProjectId">项目编号</param>
        /// <returns>企业开关信息</returns>
        Company_Project_Switch GetCompanySwitch(Int32 CompanyId, Int32 ProjectId);

        /// <summary>
        /// 刷新企业统计缓存。
        /// </summary>
        /// <param name="companyID"></param>
        /// <returns></returns>
        int RefreshStatistic(Int32 companyID);


        /// <summary>
        /// 确认报价
        /// </summary>
        /// <param name="AccountId">企业编号</param>
        /// <returns></returns>
        int ConfirmBid(Int32 AccountId, Int32 ProjectId);

        /// <summary>
        /// 确认报价2
        /// </summary>
        /// <param name="AccountId">企业编号</param>
        /// <returns></returns>
        int ConfirmBid2(Int32 AccountId, Int32 ProjectId);

        /// <summary>
        /// 解密报价
        /// </summary>
        /// <param name="CompanyId">企业编号</param>
        /// <param name="projectid">项目编号</param>
        /// <param name="pwd1">报价密码</param>
        /// <param name="pwd2">随机密码</param>
        /// <param name="BidType">目前解密状态</param>
        /// <returns>1 成功 0 失败</returns>
        int DecPrice(int? CompanyId, int projectid, string pwd1, string pwd2, BidType BidType);

        /// <summary>
        /// 获取已报价数量
        /// </summary>
        /// <param name="usercode">企业登录名</param>
        /// <returns></returns>
        DataTable GetBidCountByUserCode(string usercode);

        /// <summary>
        /// 获取未报价品规数目
        /// </summary>
        /// <returns></returns>
        int GetNoBidCount();
        /// <summary>
        /// 获取议价信息
        /// </summary>
        /// <param name="GoodsID"></param>
        /// <param name="CompanyID"></param>
        /// <returns></returns>
        DataTable getBarinPrice(string cg, string CompanyID);

        DataTable GetGoodsBarin(object objquery, int p, int p_2, out int totalrecord, string p_3, string p_4);

        /// <summary>
        /// 专家第一轮建议价
        /// </summary>
        /// <param name="qBidPrice"></param>
        /// <param name="p"></param>
        /// <param name="p_2"></param>
        /// <param name="totalrecord"></param>
        /// <param name="p_3"></param>
        /// <param name="p_4"></param>
        /// <returns></returns>
        DataTable GetBarinBidPrice(object objquery, int p, int p_2, out int totalrecord, string p_3, string p_4);
        /// <summary>
        /// 专家第二轮建议价
        /// </summary>
        /// <param name="qBidPrice"></param>
        /// <param name="p"></param>
        /// <param name="p_2"></param>
        /// <param name="totalrecord"></param>
        /// <param name="p_3"></param>
        /// <param name="p_4"></param>
        /// <returns></returns>
        DataTable GetBarinBidPrice2(object objquery, int p, int p_2, out int totalrecord, string p_3, string p_4);

        /// <summary>
        /// 企业确认议价价格
        /// </summary>
        /// <param name="goods"></param>
        /// <returns></returns>
        int UpdateBarinPrice(HZ.BidSystem.Model.View.View_BargainPrice2 goods);

        int UpdateGoodsBarin(HZ.BidSystem.Model.View.View_BargainPrice2 goods);

        /// <summary>
        /// 专家第二轮建议价查询
        /// </summary>
        /// <param name="goods"></param>
        /// <returns></returns>
        int UpdateBarinPrice2(HZ.BidSystem.Model.View.View_BargainPrice2 goods);

        int ExpertPriceSubmit(string p, int p_2);

        /// <summary>
        /// 获取专家一轮给价数据
        /// </summary>
        /// <param name="objquery"></param>
        /// <param name="p"></param>
        /// <param name="p_2"></param>
        /// <param name="totalrecord"></param>
        /// <returns></returns>
        DataTable GetExpertPrice(object objquery, int p, int p_2, out int totalrecord);

        //相似产品上限价换算
        DataTable GetLikecg(string cg);
        //同招标单元拟中标价 
        DataTable GetSortGoodsPrice(string sortid, int p, int p_2, out int totalrecord);
        /// <summary>
        /// 获取专家二轮 给价数据
        /// </summary>
        /// <param name="objquery"></param>
        /// <param name="p"></param>
        /// <param name="p_2"></param>
        /// <param name="totalrecord"></param>
        /// <returns></returns>
        DataTable GetExpertPrice2(object objquery, int p, int p_2, out int totalrecord);

        DataTable GetBarginListPrice(string Append, int p, int p_2, out int totalrecord);

        DataTable GetBarginListPrice2(string Append, int p, int p_2, out int totalrecord);

        DataTable GetExpertPriceEnd(object objquery, int p, int p_2, out int totalrecord);

        int UpdateBargainPriceBatch(DataTable priceTable, int p);

        DataTable GetExpertPriceIng(object objquery, int p, int p_2, out int totalrecord);

        DataTable GetExpertPriceEnd2(object objquery, int p, int p_2, out int totalrecord);

        DataTable GetExpertPriceEndExport2(object objquery, int p, int p_2, out int totalrecord);

        DataTable GetExpertPriceEndExport(object objquery, int p, int p_2, out int totalrecord);
        /// <summary>
        /// 获取专家议价参考价
        /// </summary>
        /// <param name="Company_goods"></param>
        /// <returns></returns>
        DataTable GetMinprie(string cg);

        int UpdateBarinPrice2Argee(int ExpertState, string bidId, string UserID);

        DataTable getNoBarinPrice(string company_goods);

        DataTable GetExpertPriceZJ(object objquery, int p, int p_2, out int totalrecord);

        DataTable GetExpertPriceZJ2(object objquery, int p, int p_2, out int totalrecord);
    }
}
